﻿@model DateTime?
@{
    var o = this; // instancia um objeto da view
    var required = o.ViewData.ModelMetadata.IsRequired;
    var obrigatorio = required ? " obrigatorio" : "";
    var isCliente = User.IsInRole("Cliente");
}
@if (isCliente)
{
    @Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datepicker-readonly " + obrigatorio, mindate = "01/01/1900", maxdate = "31/12/2015", alt = "date", @readonly = "readonly" })
}
else
{
    @Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datepicker " + obrigatorio, mindate = "01/01/1900", maxdate = "31/12/2015", alt = "date" })
}